import { BaseSelectUserSelectedItemType } from "@src/component/common/BaseSelectUser"
import { SettingGPTChannelEnum } from "@gpt/model/enum"

type SettingGPTRobotType = {
  id: number;
  /**
   * 机器人Icon
   */
  icon: string;
  /**
   * 机器人名称
   */
  name: string;
  /**
   * 机器人简介
   */
  description: string;
  /**
   * 机器人编号
   */
  robotNo: string;
  /**
   * 是否可用
   */
  enable: number;
  /**
   * 机器人设置
   * Map JSON格式
   */
  setting: string;
  /**
   * 机器人应用列表
   */
  shbGptRobotAppVOList?: SettingGPTRobotAppItem[];
}

type SettingGPTRobotModuleConfigType = {
  enable: boolean;
  disabled?: boolean;
  modules: SettingGPTRobotModuleType[];
}

type SettingGPTRobotConfigType = {
  insideModuleConfig: SettingGPTRobotModuleConfigType;
  outsideModuleConfig: SettingGPTRobotModuleConfigType;
  urlModuleConfig: SettingGPTRobotModuleConfigType;
  commonModuleConfig: SettingGPTRobotModuleConfigType;
  pluginModuleConfig: SettingGPTRobotModuleConfigType;
  modelName: string;
  share: boolean;
  openDDAssistant?: boolean;
}

type SettingGPTRobotAppConfigType = {
  translateToLanguage?: string;
  promptWordList: SettingGPTPromptWordItem[];
  insideModuleConfig: SettingGPTRobotModuleConfigType;
  outsideModuleConfig: SettingGPTRobotModuleConfigType;
}

type AIChatRobotItemComponentType = {
  
  id: number | null;
  /**
   * 机器人Icon
   */
  icon: string;
  /**
   * 机器人名称
   */
  name: string;
  /**
   * 机器人简介
   */
  description: string;
  /**
   * 机器人编号
   */
  robotNo: string;
  /**
   * 是否可用
   */
  enable: number;
  /**
   * 机器人设置
   * Map JSON格式
   */
  setting: SettingGPTRobotConfigType;
  /**
   * 是否删除
   */
  deleteTag: number
  
  releaseChannel: SettingGPTChannelEnum
}

type AIChatRobotAppItemComponentType = {
  id: string;
  setting: SettingGPTRobotAppConfigType;
}

type SettingGPTRobotModuleType = {
  name: string;
  value: string;
  enable: boolean;
  disabled: boolean;
  show: boolean;
  tooltip?: string;
  showSetting?: boolean;
}

type SettingGPTRobotChannelType = {
  name: string;
  value: number;
  enable: boolean;
  disabled: boolean;
  show: boolean;
  tooltip: string;
}

type SettingGPTRobotOutsideModuleAppGroupType = {
  appGroup: string
  appList: SettingGPTRobotOutsideModuleAppType[]
}

type SettingGPTRobotOutsideModuleAppType = {
  appDesc: string
  appId: string
  appLogo: string
  appName: string
  bizType: string
  canDelete: boolean
  canSet: boolean
  canUpdate: boolean
  platformUrl: string
  system: number
  triggerAppId: string
}

type SettingGPTRobotAppItem = {
  id: string;
  type: string;
  setting: string;
}

type SettingGPTRobotAppComponentItem = {
  id: string;
  name: string;
  icon: string;
  description: string;
  disabled?: boolean;
  show: boolean;
  system?: boolean;
  setting: Record<string, any>;
}

type SettingGPTRobotLogCountItem = {
  date: string;
  count: number;
}

type SettingGPTPromptWordItem = {
  title: string;
  content: string;
}

type ShbGptRobotAppRange = {
  robotAppId: number;
  rangeForm: ShbGptRobotAppRangeForm;
}

type ShbGptRobotAppRangeForm =  {
  users: BaseSelectUserSelectedItemType[]; 
  tags: BaseSelectUserSelectedItemType[];
  providers: BaseSelectUserSelectedItemType[];
  roles: BaseSelectUserSelectedItemType[];
}

type ShbGptRobotAppWikiType = {
  wikiTypeId: string
  robotAppId: string
}

type ShbDDAssistantDocInfo = {
  tenantId: string
  assistantId: string
  docUrl: string
}

export {
  SettingGPTRobotType,
  SettingGPTRobotConfigType,
  SettingGPTRobotAppConfigType,
  SettingGPTRobotModuleType,
  AIChatRobotItemComponentType,
  SettingGPTRobotModuleConfigType,
  SettingGPTRobotOutsideModuleAppGroupType,
  SettingGPTRobotOutsideModuleAppType,
  SettingGPTRobotAppItem,
  SettingGPTRobotAppComponentItem,
  SettingGPTRobotLogCountItem,
  AIChatRobotAppItemComponentType,
  SettingGPTPromptWordItem,
  ShbGptRobotAppRange,
  ShbGptRobotAppRangeForm,
  ShbGptRobotAppWikiType,
  SettingGPTRobotChannelType,
  ShbDDAssistantDocInfo
}
